package com.zmn.oms.services.impl.refund;

import com.zmn.common.utils.collection.CollectionUtil;
import com.zmn.oms.model.entity.refund.OrderWorkRefundDetail;
import com.zmn.oms.persistence.interfaces.refund.OrderWorkRefundDetailDao;
import com.zmn.oms.services.interfaces.refund.OrderWorkRefundDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName OrderWorkRefundDetailServiceImpl
 * @description:
 * @author: wangyanci
 * @create: 2021-09-14 10:49
 * @Version 1.0
 **/
@Slf4j
@Service
public class OrderWorkRefundDetailServiceImpl implements OrderWorkRefundDetailService {


    @Resource
    OrderWorkRefundDetailDao orderWorkRefundDetailDao;

    @Override
    public OrderWorkRefundDetail findOrderWorkRefundDetailByOrderIdAndWorkId(Long orderId, Long workId) {
        return orderWorkRefundDetailDao.findOrderWorkRefundDetailByOrderIdAndWorkId(orderId, workId);
    }

    @Override
    public int insertOrderWorkRefundDetail(OrderWorkRefundDetail orderWorkRefundDetail) {
        return orderWorkRefundDetailDao.insertOrderWorkRefundDetail(orderWorkRefundDetail);
    }

    @Override
    public int updateByDetailId(OrderWorkRefundDetail orderWorkRefundDetail) {
        return orderWorkRefundDetailDao.updateByDetailId(orderWorkRefundDetail);
    }

    @Override
    public List<OrderWorkRefundDetail> listOrderWorkRefundDetailByOrderIdList(List<Long> orderIdList) {
        if (CollectionUtil.isNullOrEmpty(orderIdList)) {
            return null;
        }
        return orderWorkRefundDetailDao.listOrderWorkRefundDetailByOrderIdList(orderIdList);
    }

    @Override
    public List<OrderWorkRefundDetail> findAll() {
        return orderWorkRefundDetailDao.findAll();
    }
}